﻿using System;

namespace ThirdBit
{
    class ThirdBit
    {
        static void Main()
        {
            Console.Write("Enetr number: ");
            int bitNum = int.Parse(Console.ReadLine()); //read number

            int mask = 1 << 3; //create mask
            int bitNumAndMask = bitNum & mask; //check if 3rd bit is 1 or 0
            int bitResult = bitNumAndMask >> 3; //return the bit
            Console.WriteLine("Third bit is {0}", bitResult); //print the bit

        }
    }
}
